from django.contrib import admin
from .models import Document

@admin.register(Document)
class DocumentAdmin(admin.ModelAdmin):
    list_display = ('title', 'file_type', 'file_size', 'upload_time', 'upload_ip', 'download_count')
    list_filter = ('file_type', 'upload_time')
    search_fields = ('title', 'upload_ip')
    date_hierarchy = 'upload_time'
    readonly_fields = ('file_size', 'upload_time', 'upload_ip', 'download_count')
